<!--
 * @Author: 段文棚
 * @Date: 2021-10-06 14:18:58
 * @LastEditTime: 2021-10-09 16:16:07
 * @LastEditors: 段文棚
 * @FilePath: \form-design-vue3\src\view\formViewer.vue
 * @Description: xxxx
-->
<template>
  <el-form>
    <el-form-item v-for="(item, index) in newCmpList" :key="index">
      <form-cmp-ui :formComponent="item"></form-cmp-ui>
    </el-form-item>
  </el-form>
</template>

<script>
import formCmpUi from "@/formCmpUi/formCmpUi.vue";
import { computed, ref } from "@vue/reactivity";
export default {
  name: "form-viewer",
  components: { formCmpUi },
  props: {
    formInfo: Object,
  },
  setup(props) {
    let myFormInfo = computed(() => {
      return props.formInfo;
    });
    let cmpList = computed(() => {
      return myFormInfo.value.forItemList;
    });
    let newCmpList=ref(JSON.parse(JSON.stringify(cmpList.value)))
    return {
      myFormInfo,
      cmpList,
      newCmpList
    };
  },
};
</script>

<style>
</style>